package com.senven.common.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @Author wt
 * @Date 2022/6/28 15:59
 * @PackageName:com.qy151.utils
 * @ClassName: WebUtils
 * @Description: TODO
 * @Version 1.0
 */
public class WebUtils {
    public static HttpServletRequest getResult(){
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        return request;
    }

    public static HttpSession getSession(){
        HttpServletRequest request = getResult();
        HttpSession session = request.getSession();
        return session;

    }
}
